package com.haoshuang.zhouzhoubang.ui.page.message.child.team

import com.haoshuang.zhouzhoubang.databinding.ItemTeamMessageBinding
import com.haoshuang.zhouzhoubang.model.bean.TeamMessageBean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter
import com.mufeng.libs.utils.view.visibleOrGone


/**
 * 
 */
class TeamMessageAdapter(data: MutableList<TeamMessageBean>) : BaseBindingQuickAdapter<TeamMessageBean, ItemTeamMessageBinding>(data) {

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: TeamMessageBean?) {
        holder.getViewBinding<ItemTeamMessageBinding>().apply {
            llReadedLine.visibleOrGone(item?.isFirstRead == true)

            tvAddTime.text = item?.add_time
            viewUnRead.visibleOrGone(item?.is_read != 1)
            tvContent.text = item?.content

            llOption.visibleOrGone(item?.who_apply == 2 && item.state == 0)
        }
    }

}